﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mindfor.Web.Features
{
	/// <summary>
	/// Proxy class for artlebedev typografer service.
	/// </summary>
	[System.Diagnostics.DebuggerStepThroughAttribute()]
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	[System.Web.Services.WebServiceBindingAttribute(Name = "TypografSoap", Namespace = "http://typograf.artlebedev.ru/webservices/")]
	internal class TypografProxy : System.Web.Services.Protocols.SoapHttpClientProtocol
	{
		/// <summary>
		/// Constructor.
		/// </summary>
		public TypografProxy()
		{
			this.Url = "http://typograf.artlebedev.ru/webservices/typograf.asmx";
		}

		/// <summary>
		/// Sync method for text processing.
		/// </summary>
		/// <param name="text">Text to process.</param>
		/// <param name="entityType">Type of text entities: html, xml, plaintext or mixed (from 1 incrementally by 1).</param>
		/// <param name="useBr">Should use line breaks.</param>
		/// <param name="useP">Should use paragraph tags.</param>
		/// <param name="maxNobr">Maximum number of non-breakable constructions (tag nobr).</param>
		/// <returns>Processed text.</returns>
		[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://typograf.artlebedev.ru/webservices/ProcessText", RequestNamespace = "http://typograf.artlebedev.ru/webservices/", ResponseNamespace = "http://typograf.artlebedev.ru/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
		public string ProcessText(string text, int entityType, bool useBr, bool useP, int maxNobr)
		{
			object[] results = this.Invoke("ProcessText", new object[] {
                        text,
                        entityType,
                        useBr,
                        useP,
                        maxNobr});
			string resultText = results[0] as string;
			return resultText == null ? null : resultText.Trim();
		}

		/// <summary>
		/// Async method for text processing.
		/// </summary>
		/// <param name="text">Text to process.</param>
		/// <param name="entityType">Type of text entities: html, xml, plaintext or mixed (from 1 incrementally by 1).</param>
		/// <param name="useBr">Should use line breaks.</param>
		/// <param name="useP">Should use paragraph tags.</param>
		/// <param name="maxNobr">Maximum number of non-breakable constructions (tag nobr).</param>
		/// <returns>Processed text.</returns>
		public System.IAsyncResult BeginProcessText(string text, int entityType, bool useBr, bool useP, int maxNobr, System.AsyncCallback callback, object asyncState)
		{
			return this.BeginInvoke("ProcessText", new object[] {
                        text,
                        entityType,
                        useBr,
                        useP,
                        maxNobr}, callback, asyncState);
		}

		public string EndProcessText(System.IAsyncResult asyncResult)
		{
			object[] results = this.EndInvoke(asyncResult);
			return ((string)(results[0]));
		}
	}
}
